package com.huangliusong.lengthoflongestsubstring;


/**
 * @author huangliusong
 * @since 2019/2/21
 * {@link }
 */
public class Test7 {
    public static void main(String[] args) {
        int[] arr={46 , 30,  82,  90 , 56  ,17  ,95,  15};
        int n=arr.length;
        int start = 0;
        int end = n-1;
        //排序
        sortArr(arr,start,end);

        //输出排序后
        for(int i=0;i<n;i++){
            if (i==0){
                System.out.print("[");
            }
            System.out.print(arr[i]+" ");
            if (i==n-1){

                System.out.print("]");
            }
        }

    }
    public static  int[] sortArr(int[] arr,int start,int end){
        int key=arr[start];
        while (end>start){
            if(arr[end]<key){
                int temp=key;
                arr[start]=arr[end];
                arr[end]=temp;

            }
        }
        System.out.println(arr);
        return null;
    }


}
